package edu.cs346.group5.backend;

import java.awt.EventQueue;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import edu.cs346.group5.logic.Login;
import edu.cs346.group5.ui.loginpages.login;

public class Main {
	
	public static void main(String[] args) {
		java.util.Date today = new java.util.Date();
		java.sql.Date sqlToday = new java.sql.Date(today.getTime());
		String noPicture = "http://images2.wikia.nocookie.net/__cb20090329133961/superfriends/images/a/a5/No_Photo_Available.jpg";
		for(int i = 0 ; i < 50; i ++){
			/*try { 
				//Database.execRaw("Insert into Wishlists(user_id,  item_id) values('" + 1135 + "', " + "'" + (i+100) + "')");
				//Database.insert("Posts", "posted_date, content, in_reply_to, posted_by", "'" + sqlToday + "', " + "'" + descriptions[i%descriptions.length] + "', " + "'" + ((i%1000) + 66) + "', " + "'" + 1135 + "'");
				//Database.execRaw("insert into Items (image, reference_url, description) values (" + "'" + noPicture + "', " + "'" + "http://www.somesite.com" + "'," + "'" + descriptions[i%descriptions.length] +i + "'" +")");
				//List<HashMap<String, Object>> results = Database.select("select * from Items where image = '" + noPicture + "' AND reference_url = '" + "http://www.somesite.com" + "' AND description = '" + descriptions[i %descriptions.length] +i  + "'ORDER BY id desc;");
				//System.out.println(results);
				//Database.execRaw("insert into Posts (posted_date, content, item_id, posted_by, category) values (" + "'" + sqlToday + "', " + "'" + topics[i%topics.length] + "'," + "'" + results.get(0).get("id") + "'," + "'" + 1135 + "'," + "'" + ((i %17) + 17) + "'" +")");
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}*/
		}
		
		try {
			UIManager.setLookAndFeel(
			    UIManager.getCrossPlatformLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e1) {
			e1.printStackTrace();
		}

		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					login frame = new login();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
}
